from machine import Pin

LED_C5 = 37
LED_B0 = 16
LED_B1 = 17
KEY_1 =  15

LED_OUT1 = Pin(("LED1", LED_C5), Pin.OUT_PP)
LED_OUT2 = Pin(("LED2", LED_B0), Pin.OUT_PP)
LED_OUT3 = Pin(("LED3", LED_B1), Pin.OUT_PP)
key_0 = Pin(("key_1", KEY_1), Pin.IN, Pin.PULL_UP)

i = 0
def func(v):
    global i
    i = ~i
    LED_OUT1.value(i)
    LED_OUT2.value(i)
    LED_OUT3.value(i)

key_0.irq(trigger=Pin.IRQ_RISING, handler=func)

